package com.eyaomall.wxmanage.common.util;

import java.util.Calendar;
import java.util.Date;

import com.lycheeframework.core.common.util.DateUtil;

public class DateUtils {
	
	 /** 
     * 获取当年的最后一天 
     * @param year 
     * @return 
     */  
	public static Date getCurrYearLast(){  
        Calendar currCal = Calendar.getInstance();    
        int currentYear = currCal.get(Calendar.YEAR);  
        return getYearLast(currentYear);  
    }
    
    /** 
     * 获取某年最后一天日期 
     * @param year 年份 
     * @return Date 
     */  
	public static Date getYearLast(int year){  
        Calendar calendar = Calendar.getInstance();  
        calendar.clear();  
        calendar.set(Calendar.YEAR, year);  
        calendar.roll(Calendar.DAY_OF_YEAR, -1);  
        Date currYearLast = calendar.getTime();  
          
        return currYearLast;  
    } 
	
	/**
	 * 比较当前日期
	 * @param start
	 * @return
	 */
	public static boolean compare(Date start){
		
		return start.compareTo(DateUtil.parseDate(DateUtil.formatYYYYMMDD(new Date()))) < 0 ? true : false;
	}
}
